package com.xinqi.modules.sys.sensitive.word.manager;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xinqi.common.mybatis.data.service.BaseService;
import com.xinqi.modules.sys.sensitive.word.domain.SensitiveWordEntity;
import com.xinqi.modules.sys.sensitive.word.dto.req.SensitiveWordQueryDTO;
import com.xinqi.modules.sys.sensitive.word.dto.rsp.SensitiveWordResultDTO;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Set;

/**
 * 敏感词管理表管理层
 *
 * @author: wenjie
 * @date: 2023/08/02
 */
public interface SensitiveWordManager extends BaseService<SensitiveWordEntity> {

    /**
     * 自定义分页查询
     */
    Page<SensitiveWordResultDTO> findPage(Page<Object> page, SensitiveWordQueryDTO query);

    /**
     * 自定义列表查询
     */
    List<SensitiveWordResultDTO> findList(SensitiveWordQueryDTO query);

    /**
     * 根据id查询 敏感词管理表数据
     */

    SensitiveWordEntity findById(Long id);

    /**
     * 根据id删除 敏感词管理表数据
     */
    @Transactional(rollbackFor = Exception.class)
    boolean deleteById(Long id);

    Set<String> findTypes();
}
